package com.automannn.atm_back.modules.system.mapper;

import com.automannn.atm_back.modules.system.entity.SysCategory;
import com.automannn.atm_back.modules.system.model.TreeSelectModel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * @author chenkh
 * @time 2020/6/26 17:03
 */
public interface SysCategoryMapper extends BaseMapper<SysCategory> {

    /**
     *  根据父级ID查询树节点数据
     * @param pid
     * @return
     */
     List<TreeSelectModel> queryListByPid(@Param("pid")  String pid, @Param("query") Map<String, String> query);

    @Select("SELECT ID FROM sys_category WHERE CODE = #{code,jdbcType=VARCHAR}")
     String queryIdByCode(@Param("code")  String code);
}
